﻿using ReactiveUI.Fody.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.ViewModels
{
    public class ErrorMsg : ViewModelBase
    {
        [Reactive] public string Title { get; set; }

        [Reactive] public string Msg { get; set; }

        /// <summary>
        /// 日志产生的时间
        /// </summary>
        [Reactive] public DateTime Time { get; set; } = DateTime.Now;

        public ErrorMsg()
        {

        }

        public ErrorMsg(string msg)
        {
            Msg = msg;
        }

        public static implicit operator ErrorMsg(string msg)
        {
            return new ErrorMsg(msg);
        }
    }

    public class WarnMsg : ViewModelBase
    {
        [Reactive] public string Title { get; set; }

        [Reactive] public string Msg { get; set; }

        /// <summary>
        /// 日志产生的时间
        /// </summary>
        [Reactive] public DateTime Time { get; set; } = DateTime.Now;

        public WarnMsg()
        {

        }

        public WarnMsg(string msg)
        {
            Msg = msg;
        }

        public static implicit operator WarnMsg(string msg)
        {
            return new WarnMsg(msg);
        }
    }
}
